package com.example.traning.mall.dal.mysql.account;

import com.example.traning.mall.dal.dataobject.account.AccountLoginLog;
import com.example.traning.mall.framework.common.pojo.PageParam;
import com.example.traning.mall.framework.common.pojo.PageResult;
import com.example.traning.mall.framework.mybatis.core.mapper.BaseMapperX;
import com.example.traning.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 用户登录日志 Mapper 接口
 * </p>
 *
 * @author Lei Yu
 * @since 2025-04-29
 */
@Mapper
public interface AccountLoginLogMapper extends BaseMapperX<AccountLoginLog> {

    /**
     * @param pageVO 分页参数
     * @return 分页结果，按照 id 降序
     */
    default PageResult<AccountLoginLog> selectPage(PageParam pageVO) {
        return selectPage(pageVO, new LambdaQueryWrapperX<AccountLoginLog>()
                .orderByDesc(AccountLoginLog::getId)
        );
    }

}
